#!/usr/bin/env python3
# encoding=utf-8

from __future__ import absolute_import, division, print_function, unicode_literals
from re import search

from setuptools import setup, find_packages
from os.path import join, abspath, dirname
from io import open

DIR = dirname(abspath(__file__))


def get_version(*parts):
    with open(join(DIR, *parts)) as fp:
        data = fp.read()
    match = search(r'''\b__version__\s*=\s*(['"])([^'"]+)\1''', data)
    version = match.group(2)
    return version


requires = []
with open(join(DIR, 'requirements.txt')) as fp:
    for line in fp:
        line = line.strip()
        if line and line not in requires:
            requires.append(line)

version = get_version('wassui/__init__.py')

setup(
    name='wassui',
    version=version,
    description='wass',
    packages=find_packages(),
    include_package_data=True,
    install_requires=requires,
    extras_require={
        'dev': [
            'mypy>=0.641;python_version>="3.5"',
            'flake8==3.6.0',
            'tox>=3.5.3',
        ],
        'build': [
            'devpi-client<6.0.0',
            'devpi>=2.1.0',
        ],
    },
    python_requires='>=3.6, <4',
    classifiers=[
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
    ],
    zip_safe=False,
)
